package eureka.customer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class RestTemplateColonyConfig {
    @Bean
    @LoadBalanced   //使用Ribbon负载均衡策略，允许使用服务名调用
    public RestTemplate getRestTemplate()
    {
        return new RestTemplate();
    }
}
